package com.wetool.wechat.model.open;

/**
 * 微信错误代码
 */
public enum WechatReturnCode {
    CODE_0(0, "ok", "成功"),
    CODE_40001(40001, "invalid credential", "不合法的调用凭证"),
    CODE_40002(40002, "invalid grant_type", "不合法的grant_type"),
    CODE_40003(40003, "invalid openid", "不合法的OpenID"),
    CODE_40004(40004, "invalid media type", "不合法的媒体文件类型"),
    CODE_40007(40007, "invalid media_id", "不合法的media_id"),
    CODE_40008(40008, "invalid template type", "不合法的message_type"),
    CODE_40009(40009, "invalid image size", "不合法的图片大小"),
    CODE_40010(40010, "invalid voice size", "不合法的语音大小"),
    CODE_40011(40011, "invalid video size", "不合法的视频大小"),
    CODE_40012(40012, "invalid thumb size", "不合法的缩略图大小"),
    CODE_40013(40013, "invalid appid", "不合法的AppID"),
    CODE_40014(40014, "invalid access_token", "不合法的access_token"),
    CODE_40015(40015, "invalid menu type", "不合法的菜单类型"),
    CODE_40016(40016, "invalid button size", "不合法的菜单按钮个数"),
    CODE_40017(40017, "invalid button type", "不合法的按钮类型"),
    CODE_40018(40018, "invalid button name size", "不合法的按钮名称长度"),
    CODE_40019(40019, "invalid button key size", "不合法的按钮KEY长度"),
    CODE_40020(40020, "invalid button url size", "不合法的url长度"),
    CODE_40023(40023, "invalid sub button size", "不合法的子菜单按钮个数"),
    CODE_40024(40024, "invalid sub button type", "不合法的子菜单类型"),
    CODE_40025(40025, "invalid sub button name size", "不合法的子菜单按钮名称长度"),
    CODE_40026(40026, "invalid sub button key size", "不合法的子菜单按钮KEY长度"),
    CODE_40027(40027, "invalid sub button url size", "不合法的子菜单按钮url长度"),
    CODE_40029(40029, "invalid code", "不合法或已过期的code"),
    CODE_40030(40030, "invalid refresh_token", "不合法的refresh_token"),
    CODE_40036(40036, "invalid template_id size", "不合法的template_id长度"),
    CODE_40037(40037, "invalid template_id", "不合法的template_id"),
    CODE_40039(40039, "invalid url size", "不合法的url长度"),
    CODE_40048(40048, "invalid url domain", "不合法的url域名"),
    CODE_40054(40054, "invalid sub button url domain", "不合法的子菜单按钮url域名"),
    CODE_40055(40055, "invalid button url domain", "不合法的菜单按钮url域名"),
    CODE_40066(40066, "invalid url", "不合法的url"),
    CODE_41001(41001, "access_token missing", "缺失access_token参数"),
    CODE_41002(41002, "appid missing", "缺失appid参数"),
    CODE_41003(41003, "refresh_token missing", "缺失refresh_token参数"),
    CODE_41004(41004, "appsecret missing", "缺失secret参数"),
    CODE_41005(41005, "media data missing", "缺失二进制媒体文件"),
    CODE_41006(41006, "media_id missing", "缺失media_id参数"),
    CODE_41007(41007, "sub_menu data missing", "缺失子菜单数据"),
    CODE_41008(41008, "missing code", "缺失code参数"),
    CODE_41009(41009, "missing openid", "缺失openid参数"),
    CODE_41010(41010, "missing url", "缺失url参数"),
    CODE_42001(42001, "access_token expired", "access_token超时"),
    CODE_42002(42002, "refresh_token expired", "refresh_token超时"),
    CODE_42003(42003, "code expired", "code超时"),
    CODE_43001(43001, "require GET method", "需要使用GET方法请求"),
    CODE_43002(43002, "require POST method", "需要使用POST方法请求"),
    CODE_43003(43003, "require https", "需要使用HTTPS"),
    CODE_43004(43004, "require subscribe", "需要订阅关系"),
    CODE_44001(44001, "empty media data", "空白的二进制数据"),
    CODE_44002(44002, "empty post data", "空白的POST数据"),
    CODE_44003(44003, "empty news data", "空白的news数据"),
    CODE_44004(44004, "empty content", "空白的内容"),
    CODE_44005(44005, "empty list size", "空白的列表"),
    CODE_45001(45001, "media size out of limit", "二进制文件超过限制"),
    CODE_45002(45002, "content size out of limit", "content参数超过限制"),
    CODE_45003(45003, "title size out of limit", "title参数超过限制"),
    CODE_45004(45004, "description size out of limit", "description参数超过限制"),
    CODE_45005(45005, "url size out of limit", "url参数长度超过限制"),
    CODE_45006(45006, "picurl size out of limit", "picurl参数超过限制"),
    CODE_45007(45007, "playtime out of limit", "播放时间超过限制（语音为60s最大）"),
    CODE_45008(45008, "article size out of limit", "article参数超过限制"),
    CODE_45009(45009, "api freq out of limit", "接口调动频率超过限制"),
    CODE_45010(45010, "create menu limit", "建立菜单被限制"),
    CODE_45011(45011, "api limit", "频率限制"),
    CODE_45012(45012, "template size out of limit", "模板大小超过限制"),
    CODE_45016(45016, "can't modify sys group", "不能修改默认组"),
    CODE_45017(45017, "can't set group name too long sys group", "修改组名过长"),
    CODE_45018(45018, "too many group now, no need to add new", "组数量过多"),
    CODE_50001(50001, "api unauthorized", "接口未授权"),;

    private final int code;
    private final String msg;
    private final String desc;

    WechatReturnCode(int code, String msg, String desc) {
        this.code = code;
        this.msg = msg;
        this.desc = desc;
    }
}
